@isTest
private class AssignmentReportControllerTest {
    static testMethod void testMethod1() {
        Id ldcProfile = [Select Id From Profile Where Name ='销售部直销销售员' ].Id;
          Id ldcProfile2 = [Select Id From Profile Where Name ='销售管理部助理' ].Id;

    	 User u1 = new User( Alias = 'samLdc1', 
                         Email = 'ldc@test.com.maike',
                         Emailencodingkey = 'UTF-8', 
                         Lastname = '用户1', 
                         Languagelocalekey = 'en_US',
                         Localesidkey = 'en_US', 
                         Profileid = ldcProfile, 
                         Country = 'United States',
                         IsActive = true,
                         SubCompany__c='四川省迈克实业有限公司',
                         UserDepartment__c='销售中心销售管理部(管理办)',
                         Timezonesidkey = 'America/Los_Angeles', 
                         EmployeeNumber = '123451',
                         CompanyName = 'Y-MKSY',
                         FederationIdentifier = '123451',
                         Username = 'Matldc1@test.com.maike',
                         ResponseCode__c = 'TTTT' );
    	 insert u1;
      
        User u2 = new User( Alias = 'samLdc2', 
                         Email = 'ldc@test.com.maike2',
                         Emailencodingkey = 'UTF-8', 
                         Lastname = '用户1', 
                         Languagelocalekey = 'en_US',
                         Localesidkey = 'en_US', 
                         Profileid = ldcProfile2, 
                         Country = 'United States',
                         IsActive = true,
                         SubCompany__c='四川省迈克实业有限公司',
                         UserDepartment__c='销售中心销售管理部(管理办)',
                         Timezonesidkey = 'America/Los_Angeles', 
                         EmployeeNumber = '123452',
                          CompanyName = 'Y-MKSY',
                         FederationIdentifier = '123452',
                         Username = 'Matldc1@test.com.maike2',
                         ResponseCode__c = 'TTTT' );
        insert u2;



        Account acc = TestUtils.createAccount();
        acc.NCICCode__c = 'xxxxdddd';
	   	acc.OwnerId = u1.Id;
         insert acc;
         
        CooperationStandard__c cs = new CooperationStandard__c();
        cs.Account__c = acc.Id;
        insert cs;

        ProductStructure__c ps = new ProductStructure__c();
        ps.Classify3__c = '仪器';
        insert ps;
        Product__c p1 = TestUtils.createProduct();
        p1.Category0__c = '仪器';
        p1.ProductStructure__c = ps.Id;
        p1.PriceCompany__c = 'MKSY';
        p1.pk_invbasdoc__c = '000001';
        p1.RecordTypeId = Utils.getRecordTypeIdByDevNameAndObjName('NCProduct', 'Product__c');
        insert p1;


        TaskEquipment__c  te = new TaskEquipment__c();
        te.Standers__c = cs.Id;
        te.InstrumentName__c = p1.Id;
        insert te;




       
         System.runAs(u1){
        	AssignmentReports__c ar= new AssignmentReports__c();
	    	ar.AccountPK__c  = 'xxxxdddd';
	    	ar.Only__c = 'xxxxx0001';
	    	insert ar ;

	    	AssignmentReportController sr = new AssignmentReportController();
	    	sr.init();

	    	sr.setError('ss');
	    	sr.getAccountSql();
            sr.accpk = 'xxxxdddd';
            sr.getEquipMent();
        }


    }
}